{{#containers-header showGroup=false}}
  <button {{action 'importYaml'}} class="btn btn-sm bg-default mr-10" disabled={{rbac-prevents resource="service" scope="project" permission="create"}}>{{t 'nav.containers.importCompose'}}</button>
  {{#link-to "authenticated.project.dns.new" scope.currentProject.id class="btn btn-sm bg-primary" disabled=(rbac-prevents resource="service" scope="project" permission="create")}}{{t 'nav.containers.addDns'}}{{/link-to}}
{{/containers-header}}

{{#if rows.length}}
  <section class="pl-0 pr-0">
    {{#sortable-table
      classNames="grid sortable-table"
      body=rows
      searchText=searchText
      sortBy=sortBy
      bulkActions=true
      descending=descending
      subRows=true
      groupByKey="namespaceId"
      groupByRef="namespace"
      pagingLabel="pagination.dnsRecord"
      subHeaders=containerHeaders
      subSearchField="instances"
      headers=headers as |sortable kind inst dt|
    }}
      {{#if (eq kind "row")}}
        {{dns-row
          model=inst
          searchText=searchText
          subMatches=sortable.subMatches
          fullColspan=sortable.fullColspan
          dt=dt
        }}
      {{else if (eq kind "group")}}
        {{namespace-group model=inst.ref fullColspan=sortable.fullColspan}}
      {{else if (eq kind "nomatch")}}
        <tr><td colspan="{{sortable.fullColspan}}" class="text-center text-muted pt-20 pb-20">{{t 'dnsPage.noMatch'}}</td></tr>
      {{else if (eq kind "norows")}}
        <tr><td colspan="{{sortable.fullColspan}}" class="text-center text-muted pt-20 pb-20">{{t 'dnsPage.noData'}}</td></tr>
      {{/if}}
    {{/sortable-table}}
  </section>
{{else}}
  {{empty-table disabled=(rbac-prevents resource="service" scope="project" permission="create") resource="container" newRoute="authenticated.project.dns.new" newTranslationKey="nav.containers.addDns"}}
{{/if}}
